#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int add(int a, int b)
{
	return a + b;
}

int(*f(int(*p)(int, int)))(int, int)
{
	return p;
}

int main1()
{
	int a = 1, b = 2;
	int(*p)(int, int) = add;
	f(add);
	f(p);
	printf("%p\n", f(add));
	printf("%p\n", f(p));
	return 0;
}

int main2()
{
	int a[] = { 1,2,3,4,5,6,7,8,9,0 };
	int* p[3];
	int i;
	for (i = 0; i < 3; i++)
	{
		p[i] = &a[2 * i + 1];
		printf("%d\n", p[i][1]);
	}
	return 0;
}

int fun(int(*p)[4], int n, int j)
{
	int m,i;
	m = p[0][j];
	for (i = 1; i < n; i++)
	{
		if (p[i][j] > m)
		{
			m = p[i][j];
		}
	}
	return m;
}

int main()
{
	int a[4][4] = { {1,2,3,4},{11,12,13,14},{21,22,23,24},{31,32,33,34} };
	int(*p)[4] = a;
	//printf("%d\n", fun(a, 4, 0));
	printf("%p\n", p);
	printf("%p\n", p+1);
	printf("%p\n", *p+1);
	printf("%d\n", *(*p+1));
	return 0;
}